<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var stu = {};                                //创建应该空对象
        stu.name = '小杨';                           //为对象添加name属性
        stu.introduce = function(){                  //为对象添加introduce方法
            console.log('My name is ' + this.name);  //在方法中使用this代表当前对象
        };
        console.log(stu.name);
        stu.introduce();
    </script>
</head>
<body>
    
</body>
</html>